set1 | set2
DaysA = {"Mon","Tue","Wed","Sat"} DaysB = {"Wed","Thu","Fri","Sat","Sun"} AllDays = DaysA|DaysB print(AllDays)
{'Mon', 'Thu', 'Sat', 'Tue', 'Fri', 'Sun', 'Wed'}
set1 & set2
DaysA = {"Mon","Tue","Wed"} DaysB = {"Wed","Thu","Fri","Sat","Sun"} AllDays = DaysA & DaysB print(AllDays)
{'Wed'}
set1 - set2
DaysA = set(["Mon","Tue","Wed"]) DaysB = set(["Wed","Thu","Fri","Sat","Sun"]) AllDays = DaysA - DaysB print(AllDays)
{'Mon', 'Tue'}